Page({
  data: {
    houseDetail: {}
  },
  editHouse () {
    wx.navigateTo({
      url: '/house_pkg/pages/form/index?id=' + this.data.houseDetail.id
    })
  },
  onLoad ({ id }) {
    console.log(id)
    this.getHouseDetail(id)
  },
  async getHouseDetail (id) {
    const { code, data } = await wx.http.get('/room/' + id)
    if (code !== 10000) return wx.utils.toast()
    this.setData({ houseDetail: data })
  }
})
